module rank {

    export class CreatePoster extends egret.DisplayObjectContainer {

        private _bitmap: egret.Bitmap;

        public level: number = 0;

        public percent: string = "";

        public nick: string = "";

        public constructor() {
            super();

            this._bitmap = new egret.Bitmap(CommonRank.spriteSheet.getTexture("poster"));
            this.addChild(this._bitmap);
        }

        public update(): void {

            let headImg: egret.Bitmap = Main.instance.headImg;
            headImg.width = headImg.height = 152;
            this.addChild(headImg);
            headImg.x = this._bitmap.width - headImg.width >> 1;
            headImg.y = 72;

            let nickTxt: egret.TextField = new egret.TextField();
            nickTxt.textColor = 0x000000;
            nickTxt.size = 30;
            nickTxt.text = this.nick;
            this.addChild(nickTxt);
            nickTxt.x = (this._bitmap.width - nickTxt.width) / 2;
            nickTxt.y = 252;

            let levelTxt: egret.TextField = new egret.TextField();
            levelTxt.size = 40;
            levelTxt.textColor = 0xF7B61C;
            levelTxt.text = "累计通过了" + this.level + "关";
            this.addChild(levelTxt);
            levelTxt.x = (this._bitmap.width - levelTxt.width) / 2;
            levelTxt.y = 346;


            let percentTxt: egret.TextField = new egret.TextField();
            percentTxt.textColor = 0xF7B61C;
            percentTxt.size = 60;
            percentTxt.text = "打败了" + this.percent + "选手";
            this.addChild(percentTxt);
            percentTxt.x = (this._bitmap.width - percentTxt.width) / 2;
            percentTxt.y = 415;
        }

        public createImg(): void {

        }

    }

}